package main

import "gofirst/ch13routine/contextlearn"

//func p() {
//	for {
//		fmt.Println("goroutine")
//	}
//}
//
//func main() {
//	//go p()
//	for i := 0; i < 1000000; i++ {
//		go func(i int) {
//			for {
//				fmt.Printf("匿名函数:%d\n", i)
//				time.Sleep(time.Millisecond * 50)
//			}
//		}(i)
//	}
//	//主死从随
//	time.Sleep(time.Second * 30)
//}

func main() {
	//waitgroup,优雅退出主协程
	//waitgroup.WaitGroupLearn()

	//互斥锁
	//lock.LockLearnWithMutex()

	//读写锁
	//rwlock.LockLearnWithRWMutex()

	//channel
	//channellearn.ChannelLearnFirst()
	//channellearn.ChannelLearnConsumer()

	//channel type
	//channeltype.ChannelTypeLearn()

	//channel 死锁的情况
	//deadlock.DeadlockResearch()

	//select
	//selectlearn.SelectLearn()

	//conetxt
	//contextlearn.ContextLearnNoContext()
	//contextlearn.ContextLearnWithContext()
	contextlearn.ContextLearnTimeout()
}
